package com.lianglu.weyue.db.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.lianglu.weyue.db.entity.BookChapterBean;
import com.lianglu.weyue.db.entity.BookRecordBean;
import com.lianglu.weyue.db.entity.CollBookBean;
import com.lianglu.weyue.db.entity.DownloadTaskBean;
import com.lianglu.weyue.db.entity.UserBean;

import com.lianglu.weyue.db.gen.BookChapterBeanDao;
import com.lianglu.weyue.db.gen.BookRecordBeanDao;
import com.lianglu.weyue.db.gen.CollBookBeanDao;
import com.lianglu.weyue.db.gen.DownloadTaskBeanDao;
import com.lianglu.weyue.db.gen.UserBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig bookChapterBeanDaoConfig;
    private final DaoConfig bookRecordBeanDaoConfig;
    private final DaoConfig collBookBeanDaoConfig;
    private final DaoConfig downloadTaskBeanDaoConfig;
    private final DaoConfig userBeanDaoConfig;

    private final BookChapterBeanDao bookChapterBeanDao;
    private final BookRecordBeanDao bookRecordBeanDao;
    private final CollBookBeanDao collBookBeanDao;
    private final DownloadTaskBeanDao downloadTaskBeanDao;
    private final UserBeanDao userBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        bookChapterBeanDaoConfig = daoConfigMap.get(BookChapterBeanDao.class).clone();
        bookChapterBeanDaoConfig.initIdentityScope(type);

        bookRecordBeanDaoConfig = daoConfigMap.get(BookRecordBeanDao.class).clone();
        bookRecordBeanDaoConfig.initIdentityScope(type);

        collBookBeanDaoConfig = daoConfigMap.get(CollBookBeanDao.class).clone();
        collBookBeanDaoConfig.initIdentityScope(type);

        downloadTaskBeanDaoConfig = daoConfigMap.get(DownloadTaskBeanDao.class).clone();
        downloadTaskBeanDaoConfig.initIdentityScope(type);

        userBeanDaoConfig = daoConfigMap.get(UserBeanDao.class).clone();
        userBeanDaoConfig.initIdentityScope(type);

        bookChapterBeanDao = new BookChapterBeanDao(bookChapterBeanDaoConfig, this);
        bookRecordBeanDao = new BookRecordBeanDao(bookRecordBeanDaoConfig, this);
        collBookBeanDao = new CollBookBeanDao(collBookBeanDaoConfig, this);
        downloadTaskBeanDao = new DownloadTaskBeanDao(downloadTaskBeanDaoConfig, this);
        userBeanDao = new UserBeanDao(userBeanDaoConfig, this);

        registerDao(BookChapterBean.class, bookChapterBeanDao);
        registerDao(BookRecordBean.class, bookRecordBeanDao);
        registerDao(CollBookBean.class, collBookBeanDao);
        registerDao(DownloadTaskBean.class, downloadTaskBeanDao);
        registerDao(UserBean.class, userBeanDao);
    }
    
    public void clear() {
        bookChapterBeanDaoConfig.clearIdentityScope();
        bookRecordBeanDaoConfig.clearIdentityScope();
        collBookBeanDaoConfig.clearIdentityScope();
        downloadTaskBeanDaoConfig.clearIdentityScope();
        userBeanDaoConfig.clearIdentityScope();
    }

    public BookChapterBeanDao getBookChapterBeanDao() {
        return bookChapterBeanDao;
    }

    public BookRecordBeanDao getBookRecordBeanDao() {
        return bookRecordBeanDao;
    }

    public CollBookBeanDao getCollBookBeanDao() {
        return collBookBeanDao;
    }

    public DownloadTaskBeanDao getDownloadTaskBeanDao() {
        return downloadTaskBeanDao;
    }

    public UserBeanDao getUserBeanDao() {
        return userBeanDao;
    }

}
